var xpcom = {
	ci: {
		json: Components.interfaces.nsIJSON,
		filepicker: Components.interfaces.nsIFilePicker
	},
	i: {
		json: function(){ return Components.classes["@mozilla.org/dom/json;1"].createInstance(xpcom.ci.json); },
		filepicker: function(){ return Components.classes["@mozilla.org/filepicker;1"].createInstance(xpcom.ci.filepicker); }
	},
	filepicker: function(s){
		var fpi = this.i.filepicker(), fpci = this.ci.filepicker;
		fpi.init(window, s.title, fpci[s.mode]);
		s.filter ? fpi.appendFilter(s.filter.name, s.filter.filter) : fpi.appendFilters(fpci.filterAll);
		var fpui = fpi.show();
		
		return (fpui == fpci.returnOK || fpui == fpci.returnReplace) ? fpi : false;
	},
	getscript: function(url){ Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader).loadSubScript(url); }
};